package com.wqz.dao;

import com.wqz.pojo.Bill;
import com.wqz.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

import static org.junit.Assert.*;

public class BillDaoTest {

    @Test
    public void getBillList() {
        SqlSession sqlSession = MyBatisUtil.createSqlSession();
        BillDao billDao = sqlSession.getMapper(BillDao.class);
        try {
            List<Bill> billList = billDao.getBillList(null,"食品");
            for(Bill bill : billList) {
                System.out.println(bill);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            MyBatisUtil.closeSqlSession(sqlSession);
        }
    }
}